import cn.dev33.satoken.secure.SaSecureUtil;
import com.litblue.starter.cache.redis.RedisCache;

import java.util.HashMap;

public class test {
    public static void main(String[] args) {
        HashMap<String, String> map = null;
        try {
            map = SaSecureUtil.rsaGenerateKeyPair();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        String pbk = map.get("public");
        System.out.println("pbk = " + pbk);
        String prk = map.get("private");
        System.out.println("prk = " + prk);
        String s = SaSecureUtil.rsaEncryptByPublic("123456", pbk);
        String s1 = SaSecureUtil.rsaDecryptByPrivate(s, prk);
        System.out.println("s1 = " + s1);

    }
}
